﻿using System;

namespace Limestone
{
    public class FieldFactory
    {
        public static IField CreateField(FieldType fieldType)
        {
            var fType = Type.GetType(fieldType.ToString(), true);
            return (IField)Activator.CreateInstance(fType);
        }

        public static IField CreateField(string fieldTypeName)
        {
            var fType = Type.GetType(fieldTypeName, true);
            return (IField)Activator.CreateInstance(fType);
        }


        public static IFieldSetting CreateFieldSetting(string fieldSettingTypeName)
        {
            var fType = Type.GetType(fieldSettingTypeName, true);
            return (IFieldSetting)Activator.CreateInstance(fType);
        }
    }
}
